package com.csd.homework1.Controller;

import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Random;

@RestController
public class RandomController {
    @RequestMapping("/random")
    public String getRandomNumber(Model model) {
        Random random = new Random();
        int randomNumber = random.nextInt(1000);
        model.addAttribute("randomNumber", randomNumber);
        return model.toString();
    }
}
